package com.ming.day250804;

import java.util.Random;
import java.util.Scanner;

public class h_game {
    public static void main(String[] args) {
        //1.创建Random对象和 Scanner对象
        Random rd = new Random();
        Scanner sc = new Scanner(System.in);
        //2.随机一个整数
        int rdNumber = rd.nextInt(100) + 1;
        while(true){
            //3.键盘录入一个整数,代表要猜的数
            int scNumber = sc.nextInt();
            //4.比较大小
            if (scNumber>rdNumber){
                System.out.println("猜大了");
            }else if(scNumber<rdNumber){
                System.out.println("猜小了");
            }else{
                System.out.println("恭喜你,猜对了");
                break;
            }

        }
        sc.close();
    }
}
